#include <stdio.h>
int larger_of(const double [], size_t);

int main(void)
{
	double arr[]={1.2, 5.1, 7.4, 4.1, 13.6 ,21.9, 52.2, 18.5};
	
	printf("The larger one is %d\n",larger_of(arr,sizeof(arr)/sizeof(arr[0])));
	
	return 0;
}
int larger_of(const double arr[], size_t size)
{
	unsigned int i;
	int min=arr[1],max=0,index=0;
//	printf("%zd\n",sizeof(arr)/sizeof(arr[0]));
//	printf("%zd\n",sizeof(arr));
	for(i=0; i<size; i++){
		if(arr[i]>=max)
			max = arr[i];				
		if(arr[i]<=min)
			min = arr[i];
	}
	
	return (max-min);
}

